Skip to content

Conversation

@userquin
Copy link
Member

@userquin userquin commented Nov 2, 2025

Description

This PR adds HMR support for Vite (only) for local SVG files, added a new hmrResolver option to resolve local icon collection/name from the file.

Linked Issues

resolves #424

Additional context

/cc @antfu maybe we can also add support for webpack and some others bundlers but I'm lazy to check them (sorry 🙏)

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/unplugin-icons@425

commit: 3aec879

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about this solution, as this would require users to write their own resolvers, which would cost too much work and introduce a lot of false negatives. And I would not expect majority of our users aware of this config and know how to write the resolver.

I would wish something more smart/automatic.

Maybe we should host the fs loading, to introduce a new option to set the relationship between files and icon conventions, where we augment FileSystemIconLoader internally, while still having the information for HMR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom icons HMR failure

3 participants